





# 191 + 32 minites ~= ~4h





docker run  -it  --runtime=nvidia  --shm-size=8g  --rm -v /root/exp/DreamCar:/root/exp/DreamCar -v /root/.cache:/root/.cache -w /root/exp/DreamCar dreamcar:v5



# conda activate dreamcar
# python3 -c 'import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available())'

# export image_path="example_data/94b33ce331b844dcb991a2020742cebf"
# export image_path="data/nuscenes_processed/scene-1100/0ba56cee062b419a80a6a90302944c19"
export image_path="data/nuscenes_processed/scene-1100/e3c44d83d35543d1b638c93943d3a180"




id=$(basename "$image_path")
export CUDA_VISIBLE_DEVICES=6
python3 preprocess_image.py  "$image_path"


## stage 1 NeRF
python3 launch.py   --train   \
   --config configs/dreamcar-coarse-nerf-nuscenes.yaml data.image_path="$image_path"      \
      data.random_camera.height=64 data.random_camera.width=64   data.height=64  data.width=64  \
   system.guidance_3d.pretrained_model_name_or_path="load/zero123/dreamcar123.ckpt"    2>&1 | tee -a logs/stage1.log




## stage 1 Neus
ckpt=outputs/dreamcar-coarse-nerf/"$id"/ckpts/last.ckpt
python3 launch.py  --train  \
    --config configs/dreamcar-coarse-neus-nuscenes.yaml  \
    system.weights="$ckpt" data.image_path="$image_path"   \
      data.random_camera.height=64 data.random_camera.width=64   data.height=64  data.width=64  \
      system.guidance_3d.pretrained_model_name_or_path="load/zero123/dreamcar123.ckpt"  2>&1 | tee -a logs/stage11.log


## stage 2 Geo
ckpt=outputs/dreamcar-coarse-neus/"$id"/ckpts/last.ckpt
python3 launch.py  --train  \
  --config configs/dreamcar-geometry-nuscenes.yaml \
  system.geometry_convert_from="$ckpt"  data.image_path="$image_path"  \
    system.guidance_3d.pretrained_model_name_or_path="load/zero123/dreamcar123.ckpt" 2>&1 | tee -a logs/stage2.log


## stage 3 Tex
ckpt=outputs/dreamcar-geometry/"$id"/ckpts/last.ckpt
python3 launch.py --train  --config configs/dreamcar-texture-nuscenes.yaml \
      data.image_path="$image_path" system.geometry_convert_from="$ckpt" \
            data.random_camera.height=128 data.random_camera.width=128   data.height=128  data.width=128  \
        system.guidance_3d.pretrained_model_name_or_path="load/zero123/dreamcar123.ckpt"  2>&1 | tee -a logs/stage3.log
 
 